class PlayerNotifier < ActionMailer::Base
  def signup_notification(player)
    setup_email(player)
    @subject    += 'Please activate your new account'
    @body[:url] ="http://localhost:3000/account/activate/#{player.activation_code}"
  end
  
  def activation(player)
    setup_email(player)
    @subject    += 'Your account has been activated!'
    @body[:url] ="http://localhost:3000/"
  end
    
  def forgot_password(player)
    setup_email(player)
    @subject    += 'Request to change your password'
    @body[:url] ="http://localhost:3000/account/reset_password/#{player.password_reset_code}" 
  end
  

  def reset_password(player)
    setup_email(player)
    @subject    += 'Your password has been reset'
  end


  protected
  def setup_email(player)
    @recipients  = "#{player.email}"
    @from        = "monkeyx@gmail.com"
    @subject     = "[Fuedal Court] "
    @sent_on     = Time.now
    @body[:player] = player
  end
  

end
